package com.yang.moyu.meta.system.service;

import com.yang.moyu.meta.common.util.ApiResult;
import com.yang.moyu.meta.system.domain.SysUser;
import com.yang.moyu.meta.system.params.LoginParam;
import com.yang.moyu.meta.system.params.ResetPwdParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * Create by 10296 on 2021/12/16
 *
 * @Description:
 */
public interface LoginService {


    /**
     * 登录
     *
     * @param loginParam 参数
     * @return ""
     */
    ApiResult login(LoginParam loginParam, HttpServletResponse response);

    /**
     * 退出登录
     *
     * @param request
     * @throws Exception
     */
    void logout(HttpServletRequest request) throws Exception;

    /**
     * 用户名
     *
     * @param userName username
     * @return ""
     * @throws Exception e
     */
    SysUser getSysUserByUserName(String userName) throws Exception;

    /**
     * 根据用户名和密码获取用户信息
     *
     * @param paramsMap ""
     * @return
     * @throws Exception
     */
    SysUser getSysUserByPassWord(Map<String, Object> paramsMap) throws Exception;

    /**
     * 检查验证码是否正确
     *
     * @param verifyToken 验证码
     * @param code        code
     * @throws Exception e
     */
    void checkVerifyCode(String verifyToken, String code) throws Exception;

    /**
     * 生成验证码
     *
     * @throws Exception e
     */
    void generateVerifyCode() throws Exception;

    /**
     * 验证Token
     *
     * @param token token
     * @return 对象
     */
    ApiResult verifyAuthToken(String token);

    /**
     * 重置密码
     *
     * @param resetPwdParam
     * @return
     */
    ApiResult resetPassword(ResetPwdParam resetPwdParam);
}
